import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { FoodTypeVO, FoodTypeForm, FoodTypeQuery } from '@/api/kitchen/food/type/types';

/**
 * 查询套餐主题列表
 * @param query
 * @returns {*}
 */

export const listFoodType = (query?: FoodTypeQuery): AxiosPromise<FoodTypeVO[]> => {
  return request({
    url: '/kitchen/foodType/list',
    method: 'get',
    params: query
  });
};


/**
 * 查询套餐主题列表
 * @param query
 * @returns {*}
 */

export const listNoPageFoodType = (query?: FoodTypeQuery): AxiosPromise<FoodTypeVO[]> => {
  return request({
    url: '/kitchen/foodType/noPage/list',
    method: 'get',
    params: query
  });
};



/**
 * 查询套餐主题详细
 * @param id
 */
export const getFoodType = (id: string | number): AxiosPromise<FoodTypeVO> => {
  return request({
    url: '/kitchen/foodType/' + id,
    method: 'get'
  });
};

/**
 * 新增套餐主题
 * @param data
 */
export const addFoodType = (data: FoodTypeForm) => {
  return request({
    url: '/kitchen/foodType',
    method: 'post',
    data: data
  });
};

/**
 * 修改套餐主题
 * @param data
 */
export const updateFoodType = (data: FoodTypeForm) => {
  return request({
    url: '/kitchen/foodType',
    method: 'put',
    data: data
  });
};

/**
 * 删除套餐主题
 * @param id
 */
export const delFoodType = (id: string | number | Array<string | number>) => {
  return request({
    url: '/kitchen/foodType/' + id,
    method: 'delete'
  });
};
